define(["jquery", "easy-admin"], function ($, ea) {
    var $=layui.jquery,
        layer=layui.layer;

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'system.notice/index',
        add_url: 'system.notice/add',
        edit_url: 'system.notice/edit',
        delete_url: 'system.notice/delete',
        export_url: 'system.notice/export',
        modify_url: 'system.notice/modify',
    };
    var admin={
        headers: function () {
            return {'X-CSRF-TOKEN': window.CONFIG.CSRF_TOKEN};
        }
    }

    return {
        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {type: 'numbers', title: '序号'},
                    {field: 'title', title: '标题'},
                    {field: 'create_time', title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
        detail:function (){
            var htmlstr=$('#content').attr('data-content');
            $('#content').html(htmlstr);
            ea.listen();
        }
    };
});